<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		
		<script type="text/javascript">
			var count;//新建一个变量代表访问的次数
			
			//查看网页有没有被访问过
			if(localStorage.getItem("count") == null){
				//说明网页从来没被访问
				count = 1;
				
			}else{
				//如果之前已经访问过.获取之前的访问次数加1
				var str = localStorage.getItem("count");
				//因为storage存储的都是字符串,而我们要数字
				count = parseInt(str)+1;
			}
			//存回去
			localStorage.setItem("count",count);
			
			if(count == 1){
				document.write("欢迎你,你是首次访问本网页");
			}else{
			
			document.write("你是第"+count+"次访问本网页!");
			}
		</script>
		
	</body>
</html>
